﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TIS.DAO;

namespace TIS.UserControl
{
    public partial class footer : System.Web.UI.UserControl
    {
        SettingDAO _settingDao = new SettingDAO();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["lang"] == null)
                {
                    Session["lang"] = 1;
                }
                BindInfo();
            }
        }

        public void BindInfo()
        {
            int langId = int.Parse(Session["lang"].ToString());

            ltlCompany.Text = _settingDao.GetValue("company", langId);
            ltlEmailCompary.Text = _settingDao.GetValue("email", langId);
            ltlFaxCompany.Text = _settingDao.GetValue("fax", langId);
            ltlPhoneCompany.Text = _settingDao.GetValue("phone", langId);
            ltlAddressCompany.Text = _settingDao.GetValue("address", langId);
            ltlWebsiteCompany.Text = _settingDao.GetValue("website", langId);

            ltlHotLine.Text = _settingDao.GetValue("hotline", langId);
            ltlYahoo.Text = _settingDao.GetValue("yahoo", langId);
            ltlSkype.Text = _settingDao.GetValue("skype", langId);
            ltlFacebook.Text = "<a href=\""+_settingDao.GetValue("facebook", langId) +"\" > <img src=\"/images/ic-facebook.png\" width=\"90\" height=\"38\" alt=\"facebook\" /> </a>" ;
            ltlGooglePlus.Text = "<a href=\"" + _settingDao.GetValue("googleplus", langId) + "\" > <img src=\"/images/ic-google.png\" width=\"90\" height=\"38\" alt=\"facebook\" /> </a>";
            ltlYoutube.Text = "<a href=\"" + _settingDao.GetValue("youtube", langId) + "\" > <img src=\"/images/ic-youtobe.png\" width=\"90\" height=\"38\" alt=\"facebook\" /> </a>";

        }
    }
}